Exporting Data
Results of eCognition analysis can be exported in several vector or raster formats. In addition, statistical information can be created or exported. There are three mechanisms:
- Data export generated by a rule set
- Data export triggered by an action
- Data export initiated by Export menu commands, based on a currently displayed map of an open project
Executing a Solution Manually for Testing
The Architect Toolbar
For testing solutions, you can execute an image analysis process manually. You can do this on a currently open project or on multiple projects. You must add and configure at least one action in the Analysis Builder.
- To execute all assembled actions, click the Run Solution button on the Architect toolbar. Alternatively, choose Analysis > Run Solution on the main menu bar.
- To execute all actions up to a certain stop, select an action and click the Run Solution Until Selected Action button on the Architect toolbar. Alternatively,choose Analysis > Run Solution Until Selected Action on the main menu bar. All actions above and including the selected action will be executed.
- To execute a single action only, select an action and click Run Selected Action button on the Architect toolbar.
- To execute a configured solution not locally but on the eCognition Server, select a project in the workspace window. Click the Run Solution on eCognition Server button on the Architect toolbar. This option is needed if the solution contains actions with workspace automation algorithms.
You can inspect the state of the analysis in the status bar of the main window. The currently processed action is displayed on the left-hand side of the status bar. In the middle is a processing indicator.
Batch Processing
Submitting Batch Jobs to a Server
eCognition Developer enables you to perform automated image analysis jobs that apply rule sets to single or multiple projects. It requires a rule set or existing ruleware file, which may be a rule set (.dcp) or a solution (.dax). Select one or more items in the Workspace window – you can select one or more projects from the right-hand pane or an entire folder from the left-hand pane. Choose Analysis > Analyze from the main menu or right-click the selected item and choose Analyze. The Start Analysis Job dialog box opens.
The Start Analysis Job dialog box
- The Job Scheduler field displays the address of the computer that assigns the analysis to one or more (if applicable) computers. It is assigned to the local computer by default
- Click Load to load a ruleware file for the image analysis – this can be a process file (extension .dcp) or a solution file (extension .dax). The Edit button lets you configure the exported results and the export paths of the image analysis job in an export template. Save lets you store the export template with the process file.
- Select the type of scene to analyze in the Analyze drop-down list.
- All scenes applies the rule set to all selected scenes in the Workspace window.
- Top scenes refers to original scenes, that have been used to create scene copies, subsets, or tiles.
- Tiles Only limits the analysis to tiles, if you have created them
- Select the Use Time-Out check box to automatically cancel image analysis after a defined period. This may be helpful in cases of unexpected image aberrations. When testing rule sets you can cancel endless loops automatically; projects are then marked as Canceled. (Time-Out applies to all processing, including tiling and stitching.)
- The Configuration tab lets you edit settings (this is rarely necessary)
- Press Start to begin the image analysis. While the image analysis is running, the state of the projects displayed in the right pane of the Workspace window will change to Waiting, then Processing, and later to Processed.
If you want to repeat an automated image analysis, for example when testing, you need to rollback all changes of the analyzed projects to restore the original version. To determine which projects have been analyzed, go to the Workspace window and sort the State column. Select the Processed ones for rollback
Configuring Exported Results
Specify where and how the results of image analysis and related data are exported. You can change the default export path and define settings such as file format.
Configure Exported Results Dialog Box
- To open the Configure Exported Results dialog box, do one of the following:
- Open the Start Analysis Job dialog box and select Edit.
- Right-click the root item in the tree view on the left pane of the Workspace window and choose Configure Analysis. Select Edit in the opening Configure Analysis dialog box.
- Display of exported items which will be exported when the analysis is performed. Apart from the project file which is exported automatically, only those items are exported that have been specified in the rule set.
- ProjectFile exports each project file (.dpr) that is created in the image analysis.
- Any Statistics the process specifies to be exported. The specified analysis process contains an export statistics algorithm called {Statistics}. Braces, as indicate that it is disabled.
- ProjectStatistics creates a .csv file by default. This presumes that the used rule set includes the Export project statistics algorithm defining the file name ProjectStatistics. (You can define the decimal separator and the column delimiter for .csv files in the configuration file of eCognition Server (eCognition.cfg) under CSV-settings.)
- ObjectStatistics creates a .csv file by default. This presumes that the rule set includes the Export object statistics algorithm defining the file name ObjectStatistics.
- Classification produces a .tif raster file by default. This presumes that the rule set includes the Export classification view algorithm defining the file name Classification.
- ExportView produces a .jpg raster file by default. This presumes that the rule set includes the Export current view algorithm defining the file name ExportView.
- ExportObjects produces a geocoded .tif raster file by default. This presumes that the rule set includes the Export thematic raster files algorithm defining the file name ExportObjects.
- ExportShapes produces a .shp vector file and additional auxiliary files. This presumes that the rule set includes the Export vector layers algorithm defining the file name ExportShapes.
- Select an item from the list.
Enable or disable the exporting functionality. Disabled items are displayed in braces: {item}, for example the {Statistics} item.
Check Advanced Cto view further configuration options.
- Scene Dir specifies the path which will be used in the {:ImgLayer(1).Dir} variable inside the (File) Path template. If this variable is not used in the template, then the Scene Dir text box is ignored.
- You can edit the Type and an appropriate Driver for exported items.For ProjectFile, you can choose between the following drivers:
- DPR – Analyst exports image objects and classes only.
- DPR – <prodsubn> additionally exports rule sets, variables, and features. Use this for further modifications of the rule set. For Statistics (ProjectStatistics, ObjectStatistics) you can select one of the following drivers:
- Select CSV and the (File) Path field is automatically filled in with the name and path of the .csv file that will be created. You can change this if you wish. In the Options text box, you can write append to append the data to those in a pre-existing file.
- Select ODBC and in the (File) Path field, you should fill in DSN=MS Access Database;DBQ=DIA.mdb where DIA.mdb is the path and name of a pre-existing Access database file.Classification, ExportView and ExportObject allow you to choose from a variety of table, raster, or vector file formats, or to specify a path.
- The (File) Path text box is automatically filled in but can be manually edited. The file name and path is made up of a number of variables in
{: }
. These variables are: - Workspc.Name represents the name of the workspace.
- Workspc.Dir represents the directory in which the workspace file is stored.
- Project.Name represents the name of the project.
- Project.Ver represents the version of the project.
- Project.Dir represents the directory in which the project file is stored.
- Scene.Dir represents the directory in which the individual scenes are stored.
- ImgLayer(n).Dir represents the folder in which the image layer is stored. You have to change the default value n to a number representing the layer in the project, for example, 1 for the first layer in a project.
If this variable is used, you can define its contents in the Scene Dir text box. - Item.Name represents the name of the exported item which is defined in the process algorithm parameters.
- Ext represents the name of the file extension.Example: A workspace New Workspace.dpj was stored in the directory D:\work\<prodname>, and the name of the Workspace is New Workspace. So the (File) Path from {:Workspace.Dir}\{:Workspace.Name}.csv means that the file path is D:\work\<prodname>\New Workspace.csv. (Note that special characters such as \ must be manually inserted.) Alternatively to using variables to define the export path, you can also make an absolute reference to your preferred directory. The file path D:\work\<prodname>\New Workspace.csv could be entered directly like that instead of using variables.
- If ODBC has been selected as Driver, SQL commands should be entered in the SQL Insert and the SQL Select text boxes.
Example for SQL Insert:
INSERT INTO statistics VALUES (%row%,%feature%,%value%)
Example for SQL Select:
SELECT * FROM statistics_cross.
- The <Insert Variable> drop-down list can be used for building up the (File) Path or the Scene Dir path by using internally held variables (for example, Workspace.Dir). To include a variable as part of the (File) Path, click in (File) Path and select a variable from <Insert Variable>. The variable will be added in the (File) Path.
- Click OK to close the dialog box.
ROUNDING IN WINDOWS AND LINUX: The rounding of floating point numbers depends on the operating system and runtime libraries. Therefore the results of statistical calculations between Linux and Windows may be slightly different.
Changing the Configuration of the Analysis Engine
These settings are designed for advanced users. Do not alter them unless you are aware of a specific need to change the default values and you understand the effects of the changes.
The Configuration tab of the Start Analysis Job dialog box enables you to review and alter the configuration information of a job before it is sent to the server. The configuration information for a job describes the required software and licenses needed to process the job. This information is used by the eCognition Server to configure the analysis engine software according to the job requirements.
An error message is generated if the installed packages do not meet the requirements specified in the Configuration tab. The configuration information is of three types: product, version and configuration.
Start Analysis Job – Configuration tab
Settings
The Product field specifies the software package name that will be used to process the job. Packages are found by using pattern matching, so the default value ‘eCognition’ will match any package that begins with ‘eCognition’ and any such package will be valid for the job.
The Version field displays the default version of the software package used to process the job. You do not normally need to change the default.
If you do need to alter the version of the Analysis Engine Software, enter the number needed in the Version text box. If the version is available it will be used. The format for version numbers is major.upgrade.update.build. For example, 9.5.1.2543 means platform version 9.5.1, build 2543. You can simply use 9.5.last to use the latest installed software package with version 9.5.
The large pane at the bottom of the dialog box displays the plug-ins, data I/O drivers and extensions required by the analysis engine to process the job. The eCognition Grid will not start a software package that does not contain all the specified components.
Plug-Ins
The plug-ins that display initially are associated with the rule set that has been loaded in the General tab. All the listed plug-ins must be present for eCognition Server to process the rule set. You can also edit the plug-ins using the buttons at the top of the window.
To add a plug-in, first load a rule set on the General tab to display the associated plug-ins. Load a plug-in by clicking the Add Plug-in button or using the context menu to open the Add a Plug-In dialog box. Use the Name drop-down box to select a plug-in and version, if needed. Click OK to display the plug-in in the list.
Drivers
The listed drivers listed must be installed for the eCognition Server to process the rule set. You might need to add a driver if it is required by the rule set and the wrong configuration is picked because of the missing information.
To add a driver, first load a rule set on the General tab to display the associated drivers. Load a driver by clicking the Add Driver button or using the context menu to open the Add a Driver dialog box. Use the drop-down Name list box to select a driver and optionally a version, if needed. Click OK to display the driver in the list.
You can also edit the version number in the list. For automatic selection of the correct version of the selected driver, delete the version number.
Extensions
The Extension field displays extensions and applications, if available. To add an extension, first load a rule set on the General tab.
Load an extension by clicking the Add Extension button or using the context menu to open the Add an Extension dialog box. Enter the name of the extension in the Name field. Click OK to display the extension in the list.
Changing the Configuration
To delete an item from the list, select the item and click the Delete Item button, or use the context menu. You cannot delete an extension.
If you have altered the initial configuration, return to the initial state by using the context menu or clicking the Reset Configuration Info button.
In the initial state, the plug-ins displayed are those associated with the rule set that has been loaded. Click the Load Client Config Info button or use the context menu to load the plug-in configuration of the client. For example, if you are using a rule set developed with an earlier version of the client, you can use this button to display all plug-ins associated with the client you are currently using.
Tiling and Stitching
Tiling and stitching is an eCognition method for handling large images. When images are so large that they begin to degrade performance, we recommend that they are cut into smaller pieces, which are then treated inpidually. Afterwards, the tile results are stitched together. The absolute size limit for an image in eCognition Developer is 231 (46,340 x 46,340 pixels).
Creating tiles splits a scene into multiple tiles of the same size and each is represented as a new map in a new project of the workspace. Projects are analyzed separately and the results stitched together (although we recommend a post-processing step).
Creating Tiles
Creating tiles is only suitable for 2D images. The tiles you create do not include results such as image objects, classes or variables.
To create a tile, you need to be in the Workspace window, which is displayed by default in views 1 and 3 on the main toolbar, or can be launched using View > Windows > Workspace. You can select a single project to tile its scenes or select a folder with projects within it.
To open the Create Tiles dialog box, choose Analysis > Create Tiles or select it by right-clicking in the Workspace window. The Create Tiles box allows you to enter the horizontal and vertical size of the tiles, based on the display unit of the project. For each scene to be tiled, a new tiles folder will be created, containing the created tile projects named tilenumber.
You can analyze tile projects in the same way as regular projects by selecting single or multiple tiles or folders that contain tiles.
Stitching Tiling Results Together
Only the main map of a tile project can be stitched together. In the Workspace window, select a project with a scene from which you created tiles. These tiles must have already been analyzed and be in the ‘processed’ state. To open the Stitch Tile Results dialog box, select Analysis > Stitch Projects from the main menu or right-click in the Workspace window.
The Job Scheduler field lets you specify the computer that is performing the analysis. It is set to http://localhost:8184
by default, which is the local machine. However, if you are running eCognition Developer over a network, you may need change this field to the address of another computer.
Click Load to load a ruleware file for image analysis — this can be a process (.dcp) or solution (.dax) file. The Edit feature allows you to configure the exported results and the export paths of the image analysis job in an export template. Clicking Save allows you to store the export template with the process file.
Select the type of scene to analyze in the Analyze drop-down list.
- All Scenes applies the rule set to all selected scenes in the Workspace window
- Top Scenes refers to the original scenes, which have been used to create scene copies, subsets or tiles
- If you have created tiles, you can select Tiles Only to filter out everything else.
Select the Use Time-Out check-box to set automatic cancellation of image analysis after a period of time that you can define. This may be helpful for batch processing in cases of unexpected image aberrations. When testing rule sets you can cancel endless loops automatically and the state of projects will marked as ‘canceled’
In rare cases it may be necessary to edit the configuration. For more details see the eCognition Developer reference book.
Interactive Workflows
The principle of an interactive workflow is to enable a user to navigate through a predefined pathway. For instance, a user can select an object or region on a ‘virtual’ slide, prompting the software to analyse the region and display relevant data.
An essential feature of this functionality is to link the high-resolution map, seen by the user, with the lower-resolution map on which the analysis is performed. When an active pixel is selected, the process creates a region around it, stored as a region variable. This region defines a subset of the active map and it is on this subset map that the analysis is performed..
The Select Input Mode algorithm lets you set the mode for user input via a graphical user interface – for most functions, set the Input Mode parameter to normal. The settings for such widgets can be defined in Widget Configuration. The input is then configured to activate the rule set that selects the subset, before taking the user back to the beginning.
Automated Data Export
Data export triggered by rule sets is executed automatically. Which items are exported is determined by export algorithms available in the Process Tree window. For a detailed description of these export algorithms, consult the Reference Book. You can modify where and how the data is exported. (Most export functions automatically generate .csv files containing attribute information. To obtain correct export results, make sure the decimal separator for .csv file export matches the regional settings of your operating system. In eCognition Developer, these settings can be changed under Tools > Options. If geo-referencing information of supported coordinate systems has been provided when creating a map, it should be exported along with the classification results and additional information if you choose Export Image Objects or Export Classification.)
Reporting Data on a Single Project
- Data export initiated by various Export menu commands applies only to the currently active map of a project. The Export Current View dialog box is used to export the current map view to a file. Copy the current map view to the clipboard and choose Export > Copy Current View to Clipboard from the main menu
- Class, object or scene statistics can be viewed and exported. They are calculated from values of image object features.
- Image objects can be exported as a thematic raster layer together with an attribute table providing detailed parameter values. The classification of a current image object level can be exported as an image file with an attribute table providing detailed parameter values. (The thematic raster layer is saved as a 32-bit image file. But not all image viewers can open these files. To view the file in eCognition Developer, add the 32-bit image file to a current map or create a new project and import the file.)
- Polygons, lines or points of selected classes can be exported to the shapefile format. The Generate Report dialog box creates an HTML page listing image objects, each specified by image object features, and optionally a thumbnail image.
Exporting Results as Raster Files
Selecting raster file from the Export Type drop-down box allows you to export image objects or classifications as raster layers together with attribute tables in csv format containing parameter values.
Image objects or classifications can be exported together with their attributes. Each image object has a unique object or class ID and the information is stored in an attached attribute table linked to the image layer. Any geo-referencing information used to create a project will be exported as well.
There are two possible locations for saving exported files:
- If a new project has been created but not yet saved, the exported files are saved to the folder where the image data are stored.
- If the project has been saved (recommended), the exported files are saved in the folder where the project has been saved.
To export image objects or classifications, open the Export Results dialog box by choosing Export > Export Results from the main menu.
Exporting image objects with the Export Results dialog box
- Select Raster file from the Export Type drop-down box
- In the Content Type drop-down box, choose one of the following:
- Image objects to export all image objects with individual object IDs and their attributes.
- Classification to export only the classification of image objects. The attached attribute table contains the class ID, color coding (RGB values) and class name by default. However, with this export type, adjacent image objects belonging to the same class can no longer be distinguished.
- From the Format drop-down list, select the file format for the export file. Supported formats are asc, tif, img, jpg, jp2, png, bmp, ntf and las/laz.
- Under Level, select the image object level for which you want to export results
- Change the default file name in the Export File Name text box if desired
- Click the Select classes button to open the Select Classes for Shape Export dialog box where you can add or remove classes to be exported
- Click the Select features button to open the Select Features for Export as Attributes dialog box where you can add or remove features to be exported
- To save the file, press Export. An attribute table in csvq file format is automatically created
- To view a preview of the attribute table that will be exported, press the Preview button
Exporting Results as Statistics
To export statistics open the Export Results dialog box by choosing Export > Export Results from the main menu. (The rounding of floating point numbers depends on the operating system and runtime libraries. Therefore the results of statistical calculations between Linux and Windows may be slightly different.)
- Choose Statistics from the Export Type drop-down box
- From the Content Type drop-down box, choose to export statistics for:
- Classes: Export statistics of selected features per selected class
- Objects: Export statistics of selected features per image object
- Scenes: Export statistics of selected features per scene
- The format must be csv. In the Options dialog box under the Output Format group, you can define the decimal separator and the column delimiter
- Select the image object level for which you want to export results in the Level drop-down box. If Scene has been selected as Content Type, this option is not available
- Change the default file name in the Export File Name field if desired
- Click the Select classes button to open the Select Classes for Shape Export dialog box where you can add or remove classes to be exported. This button is only active when choosing Class from the Content Type drop-down list
- Click the Select features button to open the Select Features for Export as Attributes dialog box where you can add or remove features to be exported
- To save the statistics to disk, press Export
- To view a preview of the attribute table that will be exported, press the Preview button.
Generating Reports
Generate Report creates a HTML page containing information about image object features and optionally a thumbnail image. To open the Generate Report dialog box, choose Export > Generate Report from the main menu.
Generate Report dialog box
- Select the Image object level for which you want to create the report from the drop-down box
- The Table header group box allows you to choose from the following options:
- User Info: Include information about the user of the project
- Project Info: Include coordinate information, resolution, and units of the map
- From the Table body group box, choose whether or not to include thumbnails of the image objects in jpeg format
- Click the Select Classes button to open the Select Classes for Report dialog box, where you can add or remove classes to be included in the report
- Click the Select features button to open the Select Features for Report dialog box where you can add or remove features to be included in the report
- Change the default file name in the Export File Name text field if desired
- Clear the Update Obj. Table check-box if you don’t want to update your object table when saving the report
- To save the report to disk, press Save Report.
Exporting Results as Shapefiles
Polygons, lines, or points of selected classes can be exported as shapefiles. As with the Export Raster File option, image objects can be exported together with their attributes and classifications. Any geo-referencing information as provided when creating a map is exported as well. The main difference to exporting image objects is that the export is not confined to polygons based on the image objects.
You can choose between three basic shape formats: points, lines and polygons. To export results as shapes, open the Export Results dialog box by choosing Export > Export Results on the main menu.
- Choose “Shape file” from the Export Type drop-down list
- From the Content Type drop-down list, choose from the following formats:
- Polygon raster to export non-overlapping polygons following the raster outline. The exported shapefile describes the border of the image objects along the pixel raster
- Polygon smoothed to export non-overlapping polygons following the smoothed outline as defined by the polygonization
- Line skeleton is based on all lines of a skeleton of each image object
- Line main line is based on the main line only of the skeleton of each image object
- Point center of gravity is the result of the calculation of the center of gravity for each image object
- Point center of main line is the result of the calculation of the center of the main line for each image object.
- The format must be shapefile (*.shp)
- Select the image object level for which you want to export results
- Select the Write Shape Attributes to .csv File check box to store the shape attributes as statistics
- Change the default file name in the Export File Name text field if necessary
- Click the Select Classes button to open the Select Classes for Shape Export dialog box where you can add or remove classes to be exported. (The class names and class colors are not exported automatically. Therefore, if you want to export shapes for more than one class and you want to distinguish the exported features by class, you should also export the feature Class name. You can use the Class Color feature to export the RGB values for the colors you have assigned to your classes.)
- Click the Select features button to open the Select Features for Export as Attributes dialog box where you can add or remove features to be exported
- To save the shapefile to disk, press Export
- To view a preview of the attribute table that will be exported, press the Preview button. The export results in a dbf file, an shp file and an shx file. The dbf file supports string, int and double formats and the columns are formatted automatically according to the data type. The column width is adjustable up to 255 characters.
Exporting the Current View
Exporting the current view is an easy way to save the map view at the current scene scale to file, which can be opened and analyzed in other applications. This export type does not include additional information such as geo-referencing, features or class assignments. To reduce the image size, you can rescale it before exporting.
Select Scale dialog box
- To export a current active map, choose Export > Current View from the main menu bar. The Select Scale dialog box opens.
- To export the map with the displayed scale, click OK. If you want to keep the original scale of the map, select the Keep Current Scene Scale check-box
- You can select a different scale compared to the current scene scale, which allows you to export the current map at a different magnification or resolution
- If you enter an invalid scale factor, it will be changed to the closest valid scale as displayed in the table
- To change the current scale mode, select from the drop-down box. Confirm with OK and the Export Image Layer dialog box opens
- Enter a file name and select the file format from the drop-down box. Note that not all formats are available for export
- Click Save to confirm. The current view settings are used; however, the zoom settings are ignored.
Copying the Current View to the Clipboard
- Exporting the current view to clipboard is an easy way to create screenshots that can then be inserted into other applications:
- Choose Export > Copy Current View to Clipboard from the main menu
- Right-click the map view and choose Copy Current View to Clipboard on the context menu.
Exporting the Contents of a Window
- Many windows contain lists or tables, which can be saved to file or to the clipboard. Others contain diagrams or images which you can copy to the clipboard. Right-click to display the context menu and choose:
- Save to File allows you to save the table contents as .csv or transposed .csv (.tcsv) file. The data can then be further analyzed in applications such as Microsoft Excel. In the Options dialog box under the Output Format group, you can define the decimal separator and the column delimiter according to your needs
- Copy to Clipboard saves the current view of the window to clipboard. It can then be inserted as a picture into other program for example, Microsoft Office or an image processing program.